import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/login'
import Upload from '@/components/upload'

import Axios from 'axios'
Axios.defaults.baseURL = 'http://116.204.184.91:8080'
Axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'
Vue.prototype.$ajax = Axios
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: {
        name: 'login'
      }
    },
    {
      path: '/login',
      name: 'login',
      component: Login
    },
    {
      path: '/upload',
      name: 'upload',
      component: Upload
    }
  ]
})
